<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    // 移除DOM中的所有的标签移除，返回一个纯文本
    function removeTag(fragment){
        return(
            new DOMParser().parseFromString(fragment, 'text/html').body.textContent || ''
        )
    }

    console.log(removeTag('<div style = "color:blue"><p>Hello</p></div>'))
</script>
</body>
</html>
